<?php
class UserController extends Controller {
    protected $userModel;
    
    public function __construct(Container $container) {
        parent::__construct($container);
        $this->userModel = $this->model('User');
    }
    
    public function list() {
        // 获取用户列表（示例数据）
        $users = $this->userModel->getDummyUsers();
        
        $data = [
            'title' => '用户列表',
            'users' => $users
        ];
        
        $this->render('user/list', $data);
    }
    
    public function detail() {
        $id = isset($_GET['id']) ? $_GET['id'] : null;
        
        if ($id) {
            // 获取用户详情（示例数据）
            $user = $this->userModel->getDummyUserById($id);
            
            $data = [
                'title' => '用户详情',
                'user' => $user
            ];
            
            $this->render('user/detail', $data);
        } else {
            echo "未提供用户ID";
        }
    }
}
?>